package com.mytest.provider.rll;

import org.apache.commons.lang3.StringUtils;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;



/**
 * @Author: llq
 * @Date: 2020/5/18
 */
@SpringBootApplication
@EnableDiscoveryClient
public class RllApplication {
    public static void main(String[] args) {
        SpringApplication.run(RllApplication.class,args);
    }

    /*@Bean
    public Redisson redisson(){
       *//* Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6379").setDateBase(0);
        return (Redisson)Redisson.create(config);*//*

    }*/

    @Bean
    public RedissonClient getRedisson(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6379").setDatabase(0);
        /*if(StringUtils.isNotBlank(password)){
            config.useSingleServer().setPassword(password);
        }*/
        return Redisson.create(config);
    }
}
